package com.gpframework.module.ctn.domain.req;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gpframework.common.annotation.Excel;
import com.gpframework.common.utils.StringUtils;
import com.gpframework.module.base.domain.req.BaseReq;
import com.gpframework.module.ctn.domain.GpCtnReachPort;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;
import java.math.BigDecimal;

/**
 * @ClassName GpCtnReachPortReq
 * @Author gpframework
 * @Date 2024-01-08
 * @Version 1.0.0
 * @Description 列表查询信息体
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class GpCtnReachPortReq extends BaseReq {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("${column.columnComment}")
     private Long id;
     @ApiModelProperty("装柜信息ID_装柜录入表")
     private Long ctnLoadedId;
    @ApiModelProperty("订单ID")
    private Long receiptId;
     @ApiModelProperty("打包信息ID")
     private Long packId;
     @ApiModelProperty("货柜安排ID")
     private Long ctnArabgeId;
     @ApiModelProperty("定货柜ID")
     private Long ctnOrderId;
     @ApiModelProperty("清关公司ID")
     private Long agentCompanyId;
     @ApiModelProperty("品牌id")
     private Long brandId;
     @ApiModelProperty("店铺id")
     private Long storeId;
    @ApiModelProperty("货柜号")
    private String ctnNo;
    @ApiModelProperty("封条号")
    private String sealNo;
    @ApiModelProperty("提单号")
    private String billNo;
    @ApiModelProperty("运费")
    private BigDecimal freightPrice;
     @ApiModelProperty("品牌名称")
     private String brandName;
     @ApiModelProperty("店铺名称")
     private String storeName;
     @ApiModelProperty("货柜序货柜序号")
     private String agentCtnNo;
     @ApiModelProperty("清关公司名称")
     private String agentCompany;
     @ApiModelProperty("供应商名称")
     private String supplier;
     @ApiModelProperty("供应商号码")
     private String supplierTel;
     @ApiModelProperty("客户名")
     private String customer;
     @ApiModelProperty("客户电话号码")
     private String customerTel;
     @ApiModelProperty("装船时间")
     private Date shipmentDate;
     @ApiModelProperty("到港时间")
     private Date reachDestinationDate;
     @ApiModelProperty("到市场时间")
     private Date reachMarketDate;
     @ApiModelProperty("操作人id")
     private Long operatorId;
     @ApiModelProperty("操作人")
     private String operatorName;
     @ApiModelProperty("排序")
     private Integer sort;
     @ApiModelProperty("备注")
     private String remarks;

    /**
    * @Description 生成查询wrapper
    * @Author greatplan@qq.com
    * @Date 2020-11-04 16:04
    * @Param [lqw]
    * @Param [isVO] 是否vo查询体，true的话走的是mapper.xml里面的查询语句，不过查询语法还是mybatis-plus，主要用于某些关联查询出一些非数据表字段
    * @Return void
    */
    public void generatorQuery(QueryWrapper<GpCtnReachPort> lqw,boolean isVo) {
        String alias = "";
        if (isVo) {
            alias = "gp.";
            lqw.eq(alias+"del_status",0);
        }
        if (this.getId() != null){
        lqw.eq(alias+"id" ,this.getId());
        }
        if (this.getCtnLoadedId() != null){
        lqw.eq(alias+"ctn_loaded_id" ,this.getCtnLoadedId());
        }
        if (this.getReceiptId() != null){
            lqw.eq(alias+"receipt_id" ,this.getReceiptId());
        }
        if (this.getPackId() != null){
        lqw.eq(alias+"pack_id" ,this.getPackId());
        }
        if (this.getCtnArabgeId() != null){
        lqw.eq(alias+"ctn_arabge_id" ,this.getCtnArabgeId());
        }
        if (this.getCtnOrderId() != null){
        lqw.eq(alias+"ctn_order_id" ,this.getCtnOrderId());
        }
        if (StringUtils.isNotBlank(this.getCtnNo())){
            lqw.eq(alias+"ctn_no" ,this.getCtnNo());
        }
        if (StringUtils.isNotBlank(this.getSealNo())){
            lqw.eq(alias+"seal_no" ,this.getSealNo());
        }
        if (StringUtils.isNotBlank(this.getBillNo())){
            lqw.eq(alias+"bill_no" ,this.getBillNo());
        }
        if (this.getAgentCompanyId() != null){
        lqw.eq(alias+"agent_company_id" ,this.getAgentCompanyId());
        }
        if (this.getBrandId() != null){
        lqw.eq(alias+"brand_id" ,this.getBrandId());
        }
        if (this.getStoreId() != null){
        lqw.eq(alias+"store_id" ,this.getStoreId());
        }
        if (StringUtils.isNotBlank(this.getBrandName())){
            lqw.like(alias+"brand_name",this.getBrandName());
        }
        if (StringUtils.isNotBlank(this.getStoreName())){
            lqw.like(alias+"store_name",this.getStoreName());
        }
        if (this.getFreightPrice() != null){
            lqw.eq(alias+"freight_price" ,this.getFreightPrice());
        }
        if (StringUtils.isNotBlank(this.getAgentCtnNo())){
        lqw.eq(alias+"agent_ctn_no" ,this.getAgentCtnNo());
        }
        if (StringUtils.isNotBlank(this.getAgentCompany())){
        lqw.eq(alias+"agent_company" ,this.getAgentCompany());
        }
        if (StringUtils.isNotBlank(this.getSupplier())){
        lqw.eq(alias+"supplier" ,this.getSupplier());
        }
        if (StringUtils.isNotBlank(this.getSupplierTel())){
        lqw.eq(alias+"supplier_tel" ,this.getSupplierTel());
        }
        if (StringUtils.isNotBlank(this.getCustomer())){
        lqw.eq(alias+"customer" ,this.getCustomer());
        }
        if (StringUtils.isNotBlank(this.getCustomerTel())){
        lqw.eq(alias+"customer_tel" ,this.getCustomerTel());
        }
        if (this.getShipmentDate() != null){
        lqw.eq(alias+"shipment_date" ,this.getShipmentDate());
        }
        if (this.getReachDestinationDate() != null){
        lqw.eq(alias+"reach_destination_date" ,this.getReachDestinationDate());
        }
        if (this.getReachMarketDate() != null){
        lqw.eq(alias+"reach_market_date" ,this.getReachMarketDate());
        }
        if (this.getOperatorId() != null){
        lqw.eq(alias+"operator_id" ,this.getOperatorId());
        }
        if (StringUtils.isNotBlank(this.getOperatorName())){
            lqw.like(alias+"operator_name",this.getOperatorName());
        }
        if (this.getSort() != null){
        lqw.eq(alias+"sort" ,this.getSort());
        }
        if (StringUtils.isNotBlank(this.getRemarks())){
        lqw.eq(alias+"remarks" ,this.getRemarks());
        }
    }
}
